package com.springboot.mybatis.service.threaddemo;

import org.omg.CORBA.TIMEOUT;

import java.sql.SQLOutput;
import java.util.Timer;
import java.util.TimerTask;

/**
 * @author sunyt31481
 * @date 2020/8/6 11:41
 * @description 定时器创建线程
 */
public class DemoTimmerTask {
    public static void main(String[] args) {
        Timer timer = new Timer();
        timer.scheduleAtFixedRate(new TimerTask() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName());
            }
        },1000,1000);
    }
}
